<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="robots" content="nofollow,noarchive,noindex">
  <title>{{ message }}</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- {{ if or (eq code 408) (eq code 425) (eq code 429) (eq code 500) (eq code 502) (eq code 503) (eq code 504) }} -->
  <meta http-equiv="refresh" content="30">
  <!-- {{ end }} -->
  <meta name="title" content="{{ code }}: {{ message | escape }}">
  <meta name="description" content="{{ description | escape }}">
  <meta property="og:title" content="{{ code }}: {{ message | escape }}">
  <meta property="og:description" content="{{ description | escape }}">
  <meta property="twitter:title" content="{{ code }}: {{ message | escape }}">
  <meta property="twitter:description" content="{{ description | escape }}">
  <style>
    :root {
      --color-primary: #f7fafc;
      --color-inverted: #a0aec0;
    }

    @media (prefers-color-scheme: dark) {
      :root {
        --color-primary: #222526;
        --color-inverted: #fff;
      }
    }

    html, body {
      margin: 0;
      padding: 0;
      min-height: 100%;
      height: 100%;
      width: 100%;
      background-color: var(--color-primary);
      color: var(--color-inverted);
      font-family: sans-serif;
      font-size: 16px;
      word-break: keep-all;
    }

    @media screen and (min-width: 2000px) {
      html, body {
        font-size: 20px;
      }
    }

    body {
      display: flex;
      justify-content: center;
      align-items: center;
    }

    main {
      display: flex;
      flex-direction: column;
    }

    article {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    article .code h1, article .desc p {
      font-size: 1.7em;
      margin: 0;
      padding: 0;
    }

    article .code {
      border-right: 2px solid;
      padding: 0.12em 0.7em;
      margin: 0;
      text-align: right;
    }

    article .code h1 {
      font-weight: normal;
    }

    article .desc {
      text-align: left;
      padding: 0.7em;
    }

    article .desc p {
      font-weight: lighter;
      text-transform: uppercase;
    }

    /* {{ if show_details }} */
    ul.details {
      list-style: none;
      margin: 1.2em 0 0 0;
      padding: 0;
      font-size: 0.8em;
    }

    ul.details li.name::first-letter {
      font-weight: bold;
    }

    ul.details li.value {
      font-family: monospace;
    }
    /* {{ end }} */
  </style>
</head>
<body>

<main>
  <article>
    <div class="code">
      <h1>{{ code }}</h1>
      <!-- {{- if show_details -}} -->
      <ul class="details">
        <!-- {{- if host -}} -->
        <li class="name" data-l10n>Host</li>
        <!-- {{- end }}{{ if original_uri -}} -->
        <li class="name" data-l10n>Original URI</li>
        <!-- {{- end }}{{ if forwarded_for -}} -->
        <li class="name" data-l10n>Forwarded for</li>
        <!-- {{- end }}{{ if namespace -}} -->
        <li class="name" data-l10n>Namespace</li>
        <!-- {{- end }}{{ if ingress_name -}} -->
        <li class="name" data-l10n>Ingress name</li>
        <!-- {{- end }}{{ if service_name -}} -->
        <li class="name" data-l10n>Service name</li>
        <!-- {{- end }}{{ if service_port -}} -->
        <li class="name" data-l10n>Service port</li>
        <!-- {{- end }}{{ if request_id -}} -->
        <li class="name" data-l10n>Request ID</li>
        <!-- {{- end -}} -->
        <li class="name" data-l10n>Timestamp</li>
      </ul>
      <!-- {{- end -}} -->
    </div>
    <div class="desc">
      <p data-l10n>{{ message }}</p>
      <!-- {{- if show_details -}} -->
      <ul class="details">
        <!-- {{- if host -}} -->
        <li class="value">{{ host }}</li>
        <!-- {{- end }}{{ if original_uri -}} -->
        <li class="value">{{ original_uri }}</li>
        <!-- {{- end }}{{ if forwarded_for -}} -->
        <li class="value">{{ forwarded_for }}</li>
        <!-- {{- end }}{{ if namespace -}} -->
        <li class="value">{{ namespace }}</li>
        <!-- {{- end }}{{ if ingress_name -}} -->
        <li class="value">{{ ingress_name }}</li>
        <!-- {{- end }}{{ if service_name -}} -->
        <li class="value">{{ service_name }}</li>
        <!-- {{- end }}{{ if service_port -}} -->
        <li class="value">{{ service_port }}</li>
        <!-- {{- end }}{{ if request_id -}} -->
        <li class="value">{{ request_id }}</li>
        <!-- {{- end -}} -->
        <li class="value">{{ nowUnix }}</li>
      </ul>
      <!-- {{- end -}} -->
    </div>
  </article>
</main>

<!-- {{- if l10n_enabled -}} -->
<script>// {{ l10nScript }}</script>
<!-- {{- end -}} -->
</body>
</html>
